package com.explorati.design_pattern.structural.flyweight;

public class Test {

	private static final String departments[] = { "RD", "QA", "PM", "BD" };

	public static void main(String[] args) {
		// for (int i = 0; i < 10; i++) {
		// String department = departments[(int) (Math.random() *
		// departments.length)];
		// Manager manager = (Manager) EmployeeFactory.getManager(department);
		// manager.report();
		// }

		// 100在缓存的范围里，不会创建对象
		Integer a = Integer.valueOf(100);
		Integer b = 100;
		int f = 100;

		// 1000不在缓存范围里，new对象
		Integer c = Integer.valueOf(1000);
		Integer d = 1000;
		int e = 1000;
		System.out.println("a==f :" + (a == f));
		System.out.println("b == f : " + (b == f));

		System.out.println("a==b : " + (a == b));
		System.out.println("c==d :" + (c == d));
		System.out.println("c==e :" + (c == e));
		System.out.println("d==e" + (d == e));
	}
}
